﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Common;
using System.ComponentModel.DataAnnotations;

namespace ElectrosLtd.Models
{
    public class ProductDetailsModel
    {
        public Product AvailableProducts { get; set; }
        public int ID { get; set; }
        public string Name { get; set; }
        public string Features { get; set; }
        public string Image { get; set; }
        public int Stock { get; set; }
        public decimal Price { get; set; }
        public DateTime DateListed { get; set; }

        [Required(ErrorMessage = "Quantity cannot be left empty")]
        public int Quantity { get; set; }

        public decimal ProductRating { get; set; }
        public int NoOfRatings { get; set; }
        public int NoOfComments { get; set; }

        public List<Comment> ProductComments { get; set; }

        public ProductDetailsModel()
        {
            ProductComments = new ProductsServ.WCFProductsClient().GetCommentsForProduct(ID).ToList();
        }
    }
}